package pack0813;

import java.util.Scanner;

public class ScoreCalc {
    int a;
    int a1;
    int a2;
    int sum = 0;
    //接收三门课程的分数
    public void fenshu(){
        Scanner in = new Scanner(System.in);
        for(int i = 0; i<3; i++){
            if(i==0){
                System.out.print("请输入JAVA成绩：");
                 a = in.nextInt();
            }else if(i==1){
                System.out.print("请输入C#成绩：");
                 a1 = in.nextInt();
            }else{
                System.out.print("请输入DB成绩：");
                 a2 = in.nextInt();
            }
        }
        zhong();
    }
    //计算总成绩
    public void zhong(){
        sum = a+a1+a2;
        System.out.println("总成绩："+sum);
        ping();
    }
    //计算平均分
    public void ping(){
        sum = sum/3;
        System.out.println("平均成绩："+sum);
    }
    public static void main(String[] args) {
        ScoreCalc ab = new ScoreCalc();
        ab.fenshu();
    }
}
